//
//  CellSecondHotDetails.m
//  练习11
//
//  Created by 张琦 on 15/11/21.
//  Copyright © 2015年 张琦. All rights reserved.
//

#import "CellSecondHotDetails.h"
#import "ModelSecondHot.h"
@interface CellSecondHotDetails ()
@property (nonatomic, retain) UILabel *labelTitle;
@property (nonatomic, retain) UIButton *buttonMore;
@property (nonatomic, retain) UIView *viewSuper;
@property (nonatomic, retain) UILabel *labelNumber;
@end
@implementation CellSecondHotDetails


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createView];
    }
    return self;
}


- (void)createView
{
    self.viewSuper = [[UIView alloc] init];
    self.viewSuper.backgroundColor = [UIColor lightGrayColor];
    [self.contentView addSubview:self.viewSuper];
    [_viewSuper release];
    
    self.labelNumber = [[UILabel alloc] init];
    self.labelNumber.backgroundColor = [UIColor cyanColor];
    [self.viewSuper addSubview:self.labelNumber];
    [_labelNumber release];
    
    self.labelTitle = [[UILabel alloc] init];
    self.labelTitle.backgroundColor = [UIColor cyanColor];
    [self.viewSuper addSubview:self.labelTitle];
    [_labelTitle release];
    
    
    

}

- (void)setDic:(NSDictionary *)dic
{
    if (_dic != dic) {
        [_dic release];
        _dic = [dic retain];
    }
    self.labelNumber.text = [NSString stringWithFormat:@"%d", self.number];
    self.labelTitle.text = [NSString stringWithFormat:@"%@\n%@", [dic objectForKey:@"name"], [dic objectForKey:@"singerName"]];
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    self.viewSuper.frame = self.contentView.frame;
    self.labelNumber.frame = CGRectMake(0, 5, 30, 40);
    self.labelTitle.frame = CGRectMake(40, 5, 200, 40);

    
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
